<template>
	<view class="">
		 
	



	</view>
</template>

<script>
 
	export default {
		components: {



		},
		data() {
			return {
				lbs_sing: '',
				shop_search_placeholder: '',
				shop_name: '',
				find: {},
				url: '',
				find_sc: {},
				t_name: '图片',
				t_type: 'imgags',
				imgList: []

			}
		},
		onLoad() {
			this.init();
		},
		methods: {
			ajax_adopt(index) {
				var that = this;
				if (index == 1) {
					this.find['is_check_pay'] = 0
				} else {
					this.find['is_check_pay'] = 1
				}
				that.on_users_cx();
			},
			ajax_is_check_examine(index) {
				var that = this;
				if (index == 2) {
					this.find['is_check_examine'] = 1
				} else {
					this.find['is_check_examine'] = 2
				}
				that.on_users_cx();
			},
			on_jiaocheng() {
				uni.navigateTo({
					url: '/pages/banmi/tx_map_jiao'
				})
			},
			confirm(vals) {
				if (vals.length == 0) {
					this.find.home_img = ''
					return
				}
				this.find['home_img'] = vals[0]['attachment']
			},

			on_img() {
				this.$refs.alertDialog_image.open()
				return

				var that = this;
				uni.chooseImage({
					count: 1,
					sizeType: ['original', 'compressed'],
					sourceType: ['album', 'camera'],
					success: res => {
						const tempFilePaths = res.tempFilePaths;
						that._Upload(tempFilePaths[0])

					}
				});
			},
			_Upload(path) {
				uni.showLoading({
					title: '正在上传中...'
				})

				var that = this;
				var img_list = new Array();
				var map = {
					path: path,
				};
				img_list.push(map);
				$http.qnFileUpload({
					files: img_list, // 必填 临时文件路径 格式: [{path: "图片地址"}]
					load: true,
					maxSize: 300000,
					typeo: '',
					onEachUpdate: res => {

					},
					onProgressUpdate: res => {


					}
				}).then(res => {

					this.url = res[0]['homg_oss_url']
					if (res[0]['homg_oss'] == 0) {
						this.url = res[0]['homg_url']
					}
					uni.hideLoading();
					that.find['home_img'] = res[0]['url'];
					that.on_users_cx();




				});
			},

			init() {
				var that = this;


				let requestParams = {

				};
				this.Htpp.post('banmi_tongcheng.Tongchengset/finds_sjsz', 'app', {
					token: false,
					datalist: requestParams
				}).then(ret => {
					var ret = ret.data;
					this.find = ret.data.find;
					this.find['top_price'] = this.find['top_price'] / 100;
					this.find_sc = ret.data.find_sc;


					this.url = ret['img_url']
				})


			},
			on_tab(index) {
				this.tabindex = index;
			},
			on_users_cx() {
				var that = this;
				var shop_name = that.find['shop_name'];
				var shop_describe = that.find['shop_describe'];
				var shop_search_placeholder = that.find['shop_search_placeholder'];
				var lbs_sing = that.find['lbs_sing'];
				var home_img = that.find['home_img'];
				var shop_num = this.find_sc['shop_num'];
				var shop_read = this.find_sc['shop_read'];
				var is_check_pay = this.find['is_check_pay'];
				var is_check_examine = this.find['is_check_examine'];
				var wx_appid = this.find['wx_appid'];
				var wx_secret = this.find['wx_secret'];
				var wx_mch_id = this.find['wx_mch_id'];
				var wx_mch_key = this.find['wx_mch_key'];
				var top_price = this.find['top_price'];

				let requestParams = {
					shop_name: shop_name,
					shop_describe: shop_describe,
					shop_search_placeholder: shop_search_placeholder,
					lbs_sing: lbs_sing,
					home_img: home_img,
					shop_num: shop_num,
					shop_read: shop_read,
					is_check_pay: is_check_pay,
					is_check_examine: is_check_examine,
					wx_appid: wx_appid,
					wx_secret: wx_secret,
					wx_mch_id: wx_mch_id,
					wx_mch_key: wx_mch_key,
					top_price: top_price
				};

				this.Htpp.post('banmi_tongcheng.Tongchengset/updates_sztcxx', 'app', {
					token: false,
					datalist: requestParams
				}).then(ret => {
					var find = ret.data.data;
					uni.showToast({
						title: ret.data.msg,
						icon: 'none'
					})

				})
			},

		}
	}
</script>

<style>
	page {
		background-color: #fff;
	}

	.feng {
		color: red;
	}
</style>